package org.deng.learn.designpattern.abstractfactory;

/**
 * @author DengLibin
 * @Description 颜色工厂
 * @Date 2019/2/12 0012 14:41
 */
public class ColorFactory extends AbstractFactory {
    @Override
    Color getColor(ColorName colorName) {
        switch (colorName){
            case RED:
                return new RedColor();
            case BLUE:
                return new BlueColor();
        }
        throw new RuntimeException("参数不正确");
    }

    @Override
    Shape getShape(ShapeName shapeName) {
        return null;
    }
}
